-
Notifications
You must be signed in to change notification settings - Fork 128
Add HTTP examples for POST PUT DELETE #849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Examples/DeleteJSON/DeleteJSON.swift
Outdated
@main | ||
struct PostJSON { | ||
static func main() async throws { | ||
let httpClient = HTTPClient(eventLoopGroupProvider: .singleton) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can actually use HTTPClient.shared
instead here which you don't need to shutdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed by e3e7f31
out of curiosity what is the best practice between using the shared vs creating your own client on the fly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this by the way, more examples are great!
2cb31f4
to
387bc3e
Compare
hi!
thanks a lot for your great lib
one thing really missing tho is more examples to help newbies using your lib, so i've added a few really basic ones to at least show how to use Post, Put & Delete
examples are made about a little local Todo api, nothing extravagant
let me know if something isn't right for y'all!